package com.endava.service;

import com.endava.dao.UsersDao;
import com.endava.model.Login;

public class LoginServiceImpl implements LoginService {

	private UsersDao usersDao;
	
	public LoginServiceImpl(UsersDao usersDao) {
		this.usersDao = usersDao;
	}

	@Override
	public Login getUserByCredentials(String username, String password) {
		if (username != null && password != null) {
			return usersDao.getUserFromDb(username, password);
		} else {
			return null;
		}
	}

}
